package com.springboot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.springboot.entity.User;
import com.springboot.service.UserService;

@Controller
@RequestMapping("user")
public class UserController {
	
	@Autowired
	private UserService userService;

	@RequestMapping(value="login.do")
	public String login(String userName, String userPass) {
		System.out.println("spring boot ......" + userName);
		User user = userService.loadUserByUserName(userName);
		System.out.println(user);
		return "index";
	}
	
	
	@RequestMapping(value="reg.do")
	public String reg(String userName, String userPass) {
		System.out.println("spring boot ......" + userName);
		User user = userService.loadUserByUserName(userName);
		System.out.println(user);
		return "index";
	}
	
}
